package com.bosssoft.cloud.wechat.core.controller;

import com.bosssoft.cloud.wechat.core.api.TemplateService;
import com.bosssoft.cloud.wechat.core.bean.template.SendInvoiceSuccessParam;
import com.bosssoft.cloud.wechat.infrastructure.bean.response.R;
import com.bosssoft.cloud.wechat.infrastructure.enums.ResultEnum;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 模板消息控制器
 *
 * @author wcy create on 2021/7/1 13:45 下午
 */

@Slf4j
@RestController
@RequestMapping("template")
public class TemplateController {
    @Autowired
    private TemplateService templateService;

    @PostMapping("set_industry")
    public R<?> setIndustry(@RequestParam String industry_id1, @RequestParam String industry_id2) {
        templateService.setIndustry(industry_id1, industry_id2);
        return new R<>(ResultEnum.SUCCESS);
    }

    @PostMapping("send_invoice_success")
    public R<?> sendInvoiceSuccess(@RequestBody SendInvoiceSuccessParam param) {
        templateService.sendInvoiceSuccessNotice(param);
        return new R<>(ResultEnum.SUCCESS);
    }
}
